package InterfazTrabajador;

import java.awt.Color;
import java.sql.SQLException;
import java.util.ArrayList;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.ListSelectionModel;
import javax.swing.border.LineBorder;

import InterfazAdministrador.ControlerAdministrador;

public class PanelTareas extends JPanel {
	public JLabel tareas;
	public JList tareasPendientes;	
	ArrayList<String> a;
	private ControlerTrabajador controlador;

	public PanelTareas(String id) throws SQLException {

		setLayout(null);
		setBackground(Color.white);
		setSize(400, 700);
		controlador = new ControlerTrabajador();		
		a = controlador.getListaTareas(id);

		tareasPendientes = new JList(a.toArray());
		tareasPendientes.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);

		tareas = new JLabel("TAREAS PENDIENTES");
		add(tareas);
		tareas.setBounds(0, 0, 200, 30);
		add(tareasPendientes);
		tareasPendientes.setBounds(10, 50, 200, 500);
	}
}
